// pages/offlineRefund/offlineRefund.js
let http = require('../../utils/request.js')

Page({

  /**
   * 页面的初始数据
   */
  data: {
    name: '申请退款',
    payPrice: '80.00',
    maskFlag: true,
    popupViewPay: true,
    // popupViewEnroll: true,
    pics: [], //图片
    imgAll: [] //返回合集
  },

  // 校区选择
  bindPickerChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      index: e.detail.value
    })
  },
  // 显示遮罩及支付弹框
  showPayPopup(e) {
    let _this = this
    let kidName = _this.data.kidName
    let fatherName = _this.data.fatherName
    let idInput = _this.data.idInput
    let projectInput = _this.data.projectInput
    let bankInput = _this.data.bankInput
    // let imgAll = _this.data.imgAll
    let phoneInput=_this.data.phoneInput  
    let identification=_this.data.id
    http.postHttp('/withdraw_add',{
      user_name:kidName,
      parent_name:fatherName,
      course_id:projectInput,
      bank:bankInput,
      phone:phoneInput,
      identification:identification
    },{}).then(res=>{
      console.log('申请退款RES',res)
    })



  },
  showPaySuccess(e) {
    this.setData({
      maskFlag: false,
      popupViewPay: true,
      popupViewEnroll: false
    })
  },
  goBackIndex(e) {
    this.setData({
      maskFlag: true,
      popupViewPay: true,
      // popupViewEnroll: true
    })
    wx.navigateTo({
      url: '/pages/myIndex/myIndex',
    })
  },
  closePopop(e) {
    this.setData({
      maskFlag: true,
      popupViewPay: true,
      popupViewEnroll: true
    })
  },

  // input监听
  kidName(e) {
    this.setData({
      kidName: e.detail.value
    })
  },
  fatherName(e) {
    this.setData({
      fatherName: e.detail.value
    })
  },
  idInput(e) {
    this.setData({
      idInput: e.detail.value
    })
  },
  projectInput(e) {
    this.setData({
      projectInput: e.detail.value
    })
  },
  bankInput(e) {
    this.setData({
      bankInput: e.detail.value
    })
  },
  phoneInput(e) {
    this.setData({
      phoneInput: e.detail.value
    })
  },



  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})